<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        var obj = Object.create({
            age:"18"
        },{
            name:{
                enumerable:true, //是否可遍历
                get:function(){
                    return this._name || "老王";
                },
                set:function(v){
                    this._name = v;
                }
            }
        });

        console.log(obj);

        for(var item in obj){
           console.log(item); 
        }

    </script>
</body>
</html>